package com.gy.def.service.impl;

import com.gy.def.dataobject.MessageTable;
import com.gy.def.repository.MessageRepository;
import com.gy.def.service.MessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

@Service
public class MessageImpl implements MessageService {

  @Autowired
  private MessageRepository messageRepository;

  @Override
  public MessageTable save(MessageTable mt) {
    return messageRepository.save(mt);
  }

  @Override
  public Page<MessageTable> findByIsDelete(int isDelete, Pageable pageable) {
    return messageRepository.findByIsDelete(isDelete, pageable);
  }

  @Override
  public MessageTable findByMessageId(String messageId) {
    return messageRepository.findByMessageId(messageId);
  }
}
